<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="dict" uri="http://www.jiyinit.com/dictTag"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
首页

<%--<select name="specialtyType" id="specialtyType" class="st_selectInut">
    <dict:option dictCode="SEX" value="" showChoose="true"/>
</select>


<form id="form" name="form" class="form-horizontal" method="post" action="${basePath}/demo/testDate">
    <div class="panel-body">
        <div class="form-group">
            <label class="col-sm-3 control-label">数量：</label>
            <div class="col-sm-9">
                <input type="text" class="col-sm-5" id="num" name="num"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">时间：</label>
            <div class="col-sm-9">
                <input type="text" class="col-sm-5" id="time" name="time"/>

            </div>
        </div>
        <button id="submit" type="submit" class="btn btn-primary btn-submit">提交</button>
    </div>
</form>

<script type="text/javascript">
    jQuery(function ($) {
        var $form = $("#form");
        var $submit = $("#submit");

        $form.validate({
            errorClass: 'error-msg',
            submitHandler: function (form) {
                $.ajax({
                    url: $form.attr("action"),
                    type: $form.attr("method"),
                    data: $form.serialize(),
                    dataType: "json",
                    cache: false,
                    beforeSend: function () {
                        $submit.prop("disabled", true);
                    },
                    success: function (data) {
                        if (data.status == '0') {
                            $submit.prop("disabled", false);
                            layer.confirm('添加成功！');
                        } else {
                            $submit.prop("disabled", false);
                            layer.alert(data.message, {
                                icon: 0,
                                skin: 'layui-layer-lan',
                                closeBtn: 0
                            });
                        }
                    },
                    error: function (xhr, textStatus, errorThrown) {
                        $submit.prop("disabled", false);
                        layer.alert("系统未知错误", {
                            icon: 0,
                            skin: 'layui-layer-lan',
                            closeBtn: 0
                        });
                    }
                });
            }
        });
    });
</script>--%>

</body>
</html>
